home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10126_Contenu Init. Scripts.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  13.0 KB  |  390 lines

  1. global gTextLanguage, gHighLightPosC, gCurrentPosC, gNbItemC, gCurrentFieldC, gThemeObj, gTitleObj, gContenuPicObj, gScreenStatus, gReturnContenu, gDataPath, gLabelLang, gContenuChange, gCurrentLabel, gThemeList, gThemeSound, gInterfaceLanguage
  2.  
  3. on ShowContenu fromDialog
  4.   set LstSpriteVisible to [1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  5.   watchCursor()
  6.   if (gScreenStatus = #ILLUSTRATION) or (gScreenStatus = #REGION) or (gScreenStatus = #ZOOM) then
  7.     FlushAllAnimationsData()
  8.     ResetActiveLabels()
  9.     ResetScreenLists()
  10.     EraseAll()
  11.   end if
  12.   addRAMobjects(#CastList, [10099, 10100, 10101, 10528, 10531, 10532, 10533, 10534, 10539, 10541, 10542, 10543, 10551, 10552, 10553, 10554, 10559, 10560, 10562, 10566, 10568, 10569])
  13.   if gContenuChange then
  14.     set the text of cast 10099 to " "
  15.     set the text of cast 10100 to " "
  16.     set the text of cast 10101 to " "
  17.     set gHighLightPosC to [0, 0, 0]
  18.     setAt(LstSpriteVisible, 9, 1)
  19.   else
  20.     setAt(LstSpriteVisible, ((gCurrentFieldC - 1) * 7) + 9, 1)
  21.   end if
  22.   repeat with i = 1 to 46
  23.     set the visible of sprite i to getAt(LstSpriteVisible, i)
  24.     set the cursor of sprite i to 0
  25.   end repeat
  26.   if not fromDialog then
  27.     set gReturnContenu to gScreenStatus
  28.   end if
  29.   set gScreenStatus to #CONTENU
  30.   UpdateLabelC()
  31.   set the textSize of field 10099 to 10
  32.   set the textHeight of field 10099 to 12
  33.   set the textSize of field 10100 to 10
  34.   set the textHeight of field 10100 to 12
  35.   set the textSize of field 10101 to 10
  36.   set the textHeight of field 10101 to 12
  37.   set gThemeList to []
  38.   set gThemeSound to []
  39.   set CurrentPath to gDataPath
  40.   if gTextLanguage = 1 then
  41.     set gThemeObj to FileIO(mnew, "read", CurrentPath & "thems.001")
  42.     set gTitleObj to FileIO(mnew, "read", CurrentPath & "titles.001")
  43.   else
  44.     if gTextLanguage = 2 then
  45.       set gThemeObj to FileIO(mnew, "read", CurrentPath & "thems.002")
  46.       set gTitleObj to FileIO(mnew, "read", CurrentPath & "titles.002")
  47.     else
  48.       if gTextLanguage = 3 then
  49.         set gThemeObj to FileIO(mnew, "read", CurrentPath & "thems.003")
  50.         set gTitleObj to FileIO(mnew, "read", CurrentPath & "titles.003")
  51.       end if
  52.     end if
  53.   end if
  54.   set the itemDelimiter to ","
  55.   set i to 0
  56.   repeat while i < 42
  57.     set ThemeLine to gThemeObj(mReadLine)
  58.     add(gThemeList, item 1 of ThemeLine)
  59.     delete item 1 of ThemeLine
  60.     add(gThemeSound, item 1 of ThemeLine)
  61.     delete item 1 of ThemeLine
  62.     set i to i + 1
  63.   end repeat
  64.   set the itemDelimiter to ","
  65.   if objectp(gThemeObj) then
  66.     gThemeObj(mdispose)
  67.   end if
  68.   setAt(gNbItemC, 1, count(gThemeList))
  69.   DuplicateCastFIX(10873 + (2 * (gInterfaceLanguage - 1)), 10868)
  70.   set the locH of sprite 34 to 457
  71.   set the locV of sprite 34 to 21
  72.   set the regPoint of cast 10868 to point(0, 0)
  73.   gotoframe(45, 1)
  74.   updateStage()
  75.   set theLine to getAt(gHighLightPosC, 1) - getAt(gCurrentPosC, 1)
  76.   if (theLine >= 0) and (theLine < 21) then
  77.     set the locV of sprite 11 to ((getAt(gHighLightPosC, 1) - getAt(gCurrentPosC, 1)) * 12) + SpriteTop(10) + 1
  78.     set the visible of sprite 11 to 1
  79.   end if
  80.   set theLine to getAt(gHighLightPosC, 2) - getAt(gCurrentPosC, 2)
  81.   if (theLine >= 0) and (theLine < 21) then
  82.     set the locV of sprite 18 to ((getAt(gHighLightPosC, 2) - getAt(gCurrentPosC, 2)) * 12) + SpriteTop(17) + 1
  83.     set the visible of sprite 18 to 1
  84.   end if
  85.   set theLine to getAt(gHighLightPosC, 3) - getAt(gCurrentPosC, 3)
  86.   if (theLine >= 0) and (theLine < 21) then
  87.     set the locV of sprite 25 to ((getAt(gHighLightPosC, 3) - getAt(gCurrentPosC, 3)) * 12) + SpriteTop(24) + 1
  88.     set the visible of sprite 25 to 1
  89.   end if
  90.   UpdateCursorC(1, getAt(gCurrentPosC, 1))
  91.   UpdateCursorC(2, getAt(gCurrentPosC, 2))
  92.   UpdateCursorC(3, getAt(gCurrentPosC, 3))
  93.   set the castNum of sprite 5 to 10001
  94.   set the castNum of sprite 6 to 10001
  95.   set the castNum of sprite 7 to 10001
  96.   set the height of sprite 10 to 252
  97.   set the height of sprite 17 to 252
  98.   set the height of sprite 24 to 252
  99.   set the stretch of sprite 11 to 1
  100.   set the height of sprite 11 to 12
  101.   set the width of sprite 11 to the width of sprite 10
  102.   set the locH of sprite 11 to getAt(the rect of sprite 10, 1)
  103.   set the stretch of sprite 18 to 1
  104.   set the height of sprite 18 to 12
  105.   set the width of sprite 18 to the width of sprite 17
  106.   set the locH of sprite 18 to getAt(the rect of sprite 17, 1)
  107.   set the stretch of sprite 25 to 1
  108.   set the height of sprite 25 to 12
  109.   set the width of sprite 25 to the width of sprite 24
  110.   set the locH of sprite 25 to getAt(the rect of sprite 24, 1)
  111.   SpriteHandCursor(3)
  112.   ResetNavigPopUp()
  113.   updateStage()
  114.   DuplicateCastFIX(10001, 10868)
  115.   if (the text of cast 10099 = " ") or gContenuChange then
  116.     set the text of cast 10100 to " "
  117.     set the text of cast 10101 to " "
  118.     ActiveButton(1)
  119.     SetWinContenu1(1, 3)
  120.   end if
  121.   if getAt(gHighLightPosC, 1) > 0 then
  122.     if getAt(gHighLightPosC, 2) > 0 then
  123.       if getAt(gHighLightPosC, 3) > 0 then
  124.         set the visible of sprite 4 to 1
  125.         SpriteHandCursor(4)
  126.         ActiveButton(2)
  127.       else
  128.         ActiveButton(1)
  129.       end if
  130.     else
  131.       ActiveButton(1)
  132.     end if
  133.   else
  134.     ActiveButton(1)
  135.   end if
  136.   if getAt(gHighLightPosC, 1) > 0 then
  137.     if getAt(gNbItemC, 2) > 21 then
  138.       set the visible of sprite 45 to 0
  139.     end if
  140.     if getAt(gHighLightPosC, 2) > 0 then
  141.       if getAt(gNbItemC, 3) > 21 then
  142.         set the visible of sprite 46 to 0
  143.       end if
  144.     end if
  145.   end if
  146.   if gContenuChange then
  147.     ActiveFieldC(1)
  148.     set gContenuChange to 0
  149.   else
  150.     updateStage()
  151.   end if
  152.   cursor(-1)
  153. end
  154.  
  155. on CloseContenu
  156.   gTitleObj(mdispose)
  157.   set the visible of sprite 4 to 1
  158.   set the visible of sprite 5 to 1
  159.   set the visible of sprite 6 to 1
  160.   set gLabelLang to gTextLanguage
  161.   set the stretch of sprite 11 to 0
  162.   set the stretch of sprite 18 to 0
  163.   set the stretch of sprite 25 to 0
  164. end
  165.  
  166. on KeyDownContenu
  167.   if (gCurrentFieldC < 4) and (gCurrentFieldC > 0) then
  168.     set NbElement to getAt(gNbItemC, gCurrentFieldC)
  169.     set HighL to getAt(gHighLightPosC, gCurrentFieldC)
  170.     set CurrentP to getAt(gCurrentPosC, gCurrentFieldC)
  171.   end if
  172.   if the keyCode = 125 then
  173.     if (gCurrentFieldC = 1) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  174.       SetWinContenu1(1, 6)
  175.       repeat while the shiftDown
  176.         SetWinContenu1(1, 6)
  177.       end repeat
  178.       SetWinContenu1(2, 1)
  179.       FindTitles(getAt(gHighLightPosC, 1))
  180.       setAt(gCurrentPosC, 2, 1)
  181.       setAt(gHighLightPosC, 2, 0)
  182.       SetWinContenu1(2, 3)
  183.     else
  184.       if (gCurrentFieldC = 2) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  185.         SetWinContenu1(2, 6)
  186.         repeat while the shiftDown
  187.           SetWinContenu1(2, 6)
  188.         end repeat
  189.         FindPicsC(getAt(gHighLightPosC, 2))
  190.         setAt(gCurrentPosC, 3, 1)
  191.         setAt(gHighLightPosC, 3, 0)
  192.         SetWinContenu1(3, 3)
  193.       else
  194.         if (gCurrentFieldC = 3) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  195.           SetWinContenu1(3, 6)
  196.           repeat while the shiftDown
  197.             SetWinContenu1(3, 6)
  198.           end repeat
  199.         end if
  200.       end if
  201.     end if
  202.     dontPassEvent()
  203.     abort()
  204.   end if
  205.   if the keyCode = 126 then
  206.     if (gCurrentFieldC = 1) and not ((HighL = 1) and (CurrentP = 1)) then
  207.       SetWinContenu1(1, 5)
  208.       repeat while the shiftDown
  209.         SetWinContenu1(1, 5)
  210.       end repeat
  211.       SetWinContenu1(2, 1)
  212.       FindTitles(getAt(gHighLightPosC, 1))
  213.       setAt(gCurrentPosC, 2, 1)
  214.       setAt(gHighLightPosC, 2, 0)
  215.       SetWinContenu1(2, 3)
  216.     else
  217.       if (gCurrentFieldC = 2) and not ((HighL = 1) and (CurrentP = 1)) then
  218.         SetWinContenu1(2, 5)
  219.         repeat while the shiftDown
  220.           SetWinContenu1(2, 5)
  221.         end repeat
  222.         FindPicsC(getAt(gHighLightPosC, 2))
  223.         setAt(gCurrentPosC, 3, 1)
  224.         setAt(gHighLightPosC, 3, 0)
  225.         SetWinContenu1(3, 3)
  226.       else
  227.         if (gCurrentFieldC = 3) and not ((HighL = 1) and (CurrentP = 1)) then
  228.           SetWinContenu1(3, 5)
  229.           repeat while the shiftDown
  230.             SetWinContenu1(3, 5)
  231.           end repeat
  232.         end if
  233.       end if
  234.     end if
  235.     dontPassEvent()
  236.     abort()
  237.   end if
  238.   if the keyCode = 115 then
  239.     if (gCurrentFieldC = 1) and not ((HighL = 1) and (CurrentP = 1)) then
  240.       setAt(gCurrentPosC, 1, 1)
  241.       setAt(gHighLightPosC, 1, 1)
  242.       SetWinContenu1(1, 3)
  243.       SetWinContenu1(2, 1)
  244.       set ListResult to field 10099
  245.       FindTitles(getAt(gHighLightPosC, 1))
  246.       setAt(gCurrentPosC, 2, 1)
  247.       setAt(gHighLightPosC, 2, 0)
  248.       SetWinContenu1(2, 3)
  249.     else
  250.       if (gCurrentFieldC = 2) and not ((HighL = 1) and (CurrentP = 1)) then
  251.         setAt(gCurrentPosC, 2, 1)
  252.         setAt(gHighLightPosC, 2, 1)
  253.         SetWinContenu1(2, 3)
  254.         FindPicsC(1)
  255.         setAt(gCurrentPosC, 3, 1)
  256.         setAt(gHighLightPosC, 3, 0)
  257.         SetWinContenu1(3, 3)
  258.       else
  259.         if (gCurrentFieldC = 3) and not ((HighL = 1) and (CurrentP = 1)) then
  260.           setAt(gCurrentPosC, 3, 1)
  261.           setAt(gHighLightPosC, 3, 1)
  262.           SetWinContenu1(3, 3)
  263.         end if
  264.       end if
  265.     end if
  266.     dontPassEvent()
  267.     abort()
  268.   end if
  269.   if the keyCode = 119 then
  270.     if (gCurrentFieldC = 1) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  271.       setAt(gCurrentPosC, 1, getAt(gNbItemC, 1) - 20)
  272.       setAt(gHighLightPosC, 1, getAt(gNbItemC, 1))
  273.       SetWinContenu1(1, 3)
  274.       SetWinContenu1(2, 1)
  275.       set ListResult to field 10099
  276.       FindTitles(getAt(gHighLightPosC, 1))
  277.       setAt(gCurrentPosC, 2, 1)
  278.       setAt(gHighLightPosC, 2, 0)
  279.       SetWinContenu1(2, 3)
  280.     else
  281.       if (gCurrentFieldC = 2) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  282.         if getAt(gNbItemC, 2) < 21 then
  283.           setAt(gCurrentPosC, 2, 1)
  284.         else
  285.           setAt(gCurrentPosC, 2, getAt(gNbItemC, 2) - 20)
  286.         end if
  287.         setAt(gHighLightPosC, 2, getAt(gNbItemC, 2))
  288.         SetWinContenu1(2, 3)
  289.         FindPicsC(getAt(gHighLightPosC, 2))
  290.         setAt(gCurrentPosC, 3, 1)
  291.         setAt(gHighLightPosC, 3, 0)
  292.         SetWinContenu1(3, 3)
  293.       else
  294.         if (gCurrentFieldC = 3) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  295.           if getAt(gNbItemC, 3) < 21 then
  296.             setAt(gCurrentPosC, 3, 1)
  297.           else
  298.             setAt(gCurrentPosC, 3, getAt(gNbItemC, 3) - 20)
  299.           end if
  300.           setAt(gHighLightPosC, 3, getAt(gNbItemC, 3))
  301.           SetWinContenu1(3, 3)
  302.         end if
  303.       end if
  304.     end if
  305.     dontPassEvent()
  306.     abort()
  307.   end if
  308.   if the keyCode = 116 then
  309.     if (gCurrentFieldC = 1) and not ((HighL = 1) and (CurrentP = 1)) then
  310.       SetWinContenu2(1, 12)
  311.       repeat while the shiftDown
  312.         SetWinContenu2(1, 12)
  313.       end repeat
  314.       SetWinContenu1(2, 1)
  315.       FindTitles(getAt(gHighLightPosC, 1))
  316.       setAt(gCurrentPosC, 2, 1)
  317.       setAt(gHighLightPosC, 2, 0)
  318.       SetWinContenu1(2, 3)
  319.     else
  320.       if (gCurrentFieldC = 2) and not ((HighL = 1) and (CurrentP = 1)) then
  321.         SetWinContenu2(2, 12)
  322.         repeat while the shiftDown
  323.           SetWinContenu2(2, 12)
  324.         end repeat
  325.         FindPicsC(getAt(gHighLightPosC, 2))
  326.         setAt(gCurrentPosC, 3, 1)
  327.         setAt(gHighLightPosC, 3, 0)
  328.         SetWinContenu1(3, 3)
  329.       else
  330.         if (gCurrentFieldC = 3) and not ((HighL = 1) and (CurrentP = 1)) then
  331.           SetWinContenu2(3, 12)
  332.           repeat while the shiftDown
  333.             SetWinContenu2(3, 12)
  334.           end repeat
  335.         end if
  336.       end if
  337.     end if
  338.     dontPassEvent()
  339.     abort()
  340.   end if
  341.   if the keyCode = 121 then
  342.     if (gCurrentFieldC = 1) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  343.       SetWinContenu2(1, 13)
  344.       repeat while the shiftDown
  345.         SetWinContenu2(1, 13)
  346.       end repeat
  347.       SetWinContenu1(2, 1)
  348.       FindTitles(getAt(gHighLightPosC, 1))
  349.       setAt(gCurrentPosC, 2, 1)
  350.       setAt(gHighLightPosC, 2, 0)
  351.       SetWinContenu1(2, 3)
  352.     else
  353.       if (gCurrentFieldC = 2) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  354.         SetWinContenu2(2, 13)
  355.         repeat while the shiftDown
  356.           SetWinContenu2(2, 13)
  357.         end repeat
  358.         FindPicsC(getAt(gHighLightPosC, 2))
  359.         setAt(gCurrentPosC, 3, 1)
  360.         setAt(gHighLightPosC, 3, 0)
  361.         SetWinContenu1(3, 3)
  362.       else
  363.         if (gCurrentFieldC = 3) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 20)))) then
  364.           SetWinContenu2(3, 13)
  365.           repeat while the shiftDown
  366.             SetWinContenu2(3, 13)
  367.           end repeat
  368.         end if
  369.       end if
  370.     end if
  371.     dontPassEvent()
  372.     abort()
  373.   end if
  374.   if the key = " " then
  375.     dontPassEvent()
  376.     abort()
  377.   end if
  378.   if (the keyCode = 123) or (the keyCode = 124) then
  379.     return 
  380.   end if
  381.   if the machineType <> 256 then
  382.     KeyContenu_Mac()
  383.   else
  384.     KeyContenu_PC()
  385.   end if
  386.   if (charToNum(the key) < 33) or (charToNum(the key) > 126) or the commandDown then
  387.     MenuKey(the key)
  388.   end if
  389. end
  390.